import './index.css'
import {_product} from '@/service/product-service.js'
import {_User} from '@/service/user-service.js'
var nav = {
	init : function(){
		this.bindEvent();
		this.loadUserInfo();
	},
	bindEvent: function(){
		let js_login = document.getElementsByClassName("js-login")[0]
		js_login.addEventListener("click",function(){
			
			_product.getProductList(function(data,msg){
				console.log(data)
				window.location.href="./view/login.html"
			},function(errMsg){
				console.log(errMsg)
			})

			
		})


	},
	loadUserInfo : function(){
		_User.checkLogin(function(data,msg){
			console.log(data)
		},function(errMsg){
			console.log(errMsg)
		})
	}
}
nav.init()